home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlStatusBarSetTip.au3 < prev    next >
Text File  |  2007-09-08  |  2KB  |  50 lines

  1. Opt("MustDeclareVars", 1)
  2.  
  3. #include <GUIConstants.au3>
  4. #Include <GuiStatusBar.au3>
  5.  
  6. Local $gui, $StatusBar1, $msg
  7. Local $a_PartsRightEdge[3] = [100, 200, -1]
  8. Local $a_PartsText[3] = ["", "Force tip to be shown when text is more than fits in the box", "Even More Text"]
  9.  
  10. ;================================================================
  11. ; Example 1 - Using AutoIt Control
  12. ;================================================================
  13. $gui = GUICreate("Status Bar Set Tip", 500, -1, -1, -1, $WS_SIZEBOX)
  14.  
  15. $StatusBar1 = _GUICtrlStatusBarCreate($gui, $a_PartsRightEdge, $a_PartsText, $SBT_TOOLTIPS)
  16. _GUICtrlStatusBarSetIcon($StatusBar1, 0, "shell32.dll", 21)
  17. _GUICtrlStatusBarSetTip($StatusBar1, 0, "Tip works when only icon in part or text exceeds part")
  18. _GUICtrlStatusBarSetTip($StatusBar1, 1, "Force tip to be shown when text is more than fits in the box")
  19. _GUICtrlStatusBarSetTip($StatusBar1, 2, "Part 3")
  20.  
  21. GUISetState(@SW_SHOW)
  22.  
  23. While 1
  24.     $msg = GUIGetMsg()
  25.     Select
  26.         Case $msg = $GUI_EVENT_RESIZED
  27.             _GUICtrlStatusBarResize($StatusBar1)
  28.         Case $msg = $GUI_EVENT_CLOSE
  29.             ExitLoop
  30.         Case Else
  31.             ;;;;;
  32.     EndSelect
  33.     
  34. WEnd
  35. GUIDelete()
  36.  
  37. ;================================================================
  38. ; Example 2 - External Control
  39. ;================================================================
  40. Opt("WinTitleMatchMode", 4)
  41. Local $h_win = WinGetHandle("classname=SciTEWindow")
  42. Local $h_status = ControlGetHandle($h_win, "", "msctls_statusbar321")
  43. Local $s_text = _GUICtrlStatusBarGetText($h_status)
  44. _GUICtrlStatusBarSetText($h_status, "Text has been set")
  45. _GUICtrlStatusBarSetText($h_status, "")
  46. _GUICtrlStatusBarSetIcon($h_status, 0, "shell32.dll", 21)
  47. Sleep(10000)
  48. _GUICtrlStatusBarSetIcon($h_status, 0)
  49. _GUICtrlStatusBarSetText($h_status, $s_text)
  50.